<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/security/tags"
	prefix="sec"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="org.jackysoft.report.TradeType"%>
<%@ page import="org.jackysoft.report.ProductValidation" %>
<%@ page import="org.jackysoft.util.*"%>
<%@ page import="org.jackysoft.entity.ContractType"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@ include file="../commons/headfiles-jquery.jsp"%>
<link href="../css/apps/contract/input.css" rel="stylesheet" media="screen" />


<title>添加编辑合同数据项</title>
<script type="text/javascript" src="../scripts/apps/contract/input.js"></script>	
</head>
<body>
<form id="cform">
<a name="#top"></a>
	<table class="table table-striped table-bordered table-condensed table-hover">
		<tbody>
			<tr>
				<th>代码</th>
				<th><input type="text" id="code" /></th>
			</tr>
			<tr>
			    <th>名称</th>
			    <th><span id="name" class="label label-info"></span></th>
			</tr>
			<%
			 request.setAttribute("validations", ProductValidation.getOptions(false));			
			 request.setAttribute("ctypes", ContractType.getOptions(false));
			%>

			<tr>
				<th>验收状态</th>
				<th>
					<select onchange="onListPropertyChange('validation',this)">							
					   <option value="-1">请选择验收状态</option>	
                       ${validations}

					</select>
				</th>
			</tr>				
			<tr>
				<th>配套类型</th>
				<th>
					<select onchange="onListPropertyChange('contractType',this)">							
					   <option value="-1">请选择配套类型</option>	
                       ${ctypes}
					</select>
				</th>
			</tr>	
			
			<tr>
			  <th>合同价</th>
			  <th><input onblur="judgeNumber(this)" onchange="onValuePropertyChange('price',this)" value="0" /></th>
			</tr>		
			<tr>
				<th>库存总量</th>
				<th><input onblur="judgeNumber(this)" onchange="onValuePropertyChange('storage',this);" value="0" /></th>
			</tr>
			<tr>
				<th>约定事项</th>
				<th><textarea onchange="onTextPropertyChange('remark',this)"></textarea></th>
			</tr>
			<tr>
				<th>
			
					合同数和缴库
					<ul class="inline affix" style="top:100px">
			<li><a class="btn btn-success btn-mini" href="#top">顶部</a></li>
			<li><a class="btn btn-success btn-mini" href="#bottom">底部</a></li>
<c:forTokens items="1,2,3,4,5,6,7,8,9,10,11,12" delims=","
						var="m">
	       <li>
	         <a class="btn btn-danger btn-mini" href="#${m }">${m }月</a>
	       </li>		
			
						
	</c:forTokens>
	 
	 <li> <button class="btn btn-info" type="button" onclick="addItem()" >添加合同项</button></li>
				</ul>
			
				</th>
				<th>
				<script type="text/javascript">
				   var imx = 0;
				   var m = 0;
				</script>
				<c:forTokens items="1,2,3,4,5,6,7,8,9,10,11,12" delims=","
						var="m">
						<script type="text/javascript">
						    imx = ${m-1};
						    m = ${m};
						    line.list[imx]={
						    					month:m,
						    					assumpsit:0,
						    					custom:0						    					
						    					};
						</script>
						<a name="#${m}"></a>
						<ul>
							<li>月份  <label class="label label-info">${m}</label></li>
							<li>合同数<input type="text" onblur="judgeNumber(this)" onchange="onIndexedPropertyChange(${m-1},'assumpsit',this)" value="0"  /></li>
							<li>缴库数<input type="text" onblur="judgeNumber(this)" onchange="onIndexedPropertyChange(${m-1},'custome',this)"   value="0"  /></li>
						</ul>
                     <div class="horilize-line"></div>

					</c:forTokens></th>
			</tr>
		</tbody>
        <tfoot>
          <tr>
           <th></th>
           <th><a name="#bottom"></a>
              <button class="btn btn-info" type="button" onclick="addItem()" >添加合同项</button>
              <button class="btn" type="button" onclick="window.close()">关闭</button>
           </th>
          </tr>
        </tfoot>
	</table>
	</form>
	
</body>
</html>